package com.xiaoxin.nmzp.interfaces;

import com.xiaoxin.nmzp.validator.ExperienceValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE,ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = ExperienceValidator.class)
public @interface ValidIfHasExperience {
    String message() default "Work experience is required and must be valid when isWorkExperience is true";

    boolean isWorkExperience() default false;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
